package ysq.xyg.sys.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统管理-通用配置实体类
 *
 * @author shengQiang yu
 * @date 2019-3-28 16:42:12
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_sys_config")
public class SysConfig implements Serializable{

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * code值
     */
    @Column(name = "code")
    private String code;

    /**
     * 类型1=文本框2=富文本编辑器
     */
    @Column(name = "type")
    private String type;

    /**
     * 配置名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 配置内容
     */
    @Column(name = "content")
    private String content;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 删除标注:1、正常，2、删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 修改人
     */
    @Column(name = "update_user")
    private String updateUser;


    public SysConfig(SysUser sysUser) {
        this.id= BaseUtil.uId();
        this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.createUser = sysUser.getId();
        this.updateTime = new Date();
        this.updateUser = sysUser.getId();
    }
}